# coding: utf-8

import webapp2
import data.provider
import core.crawl 

class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        #self.response.out.write('Hello, Social Curator World!')
        
        crawler = core.crawl.CrawlProducts()
        dic = data.provider.Providers().getProviderList()
        
        provider=u"와우대박"
        count = crawler.crawlSocialProducts(provider, dic[provider][1], dic[provider][0])
        self.response.out.write("New Item:" + str(count))
        
app = webapp2.WSGIApplication([('/*', MainPage)], debug=True)